import QtQuick 2.0
import org.qtproject.znews_qt 1.0

import "../common"
import "../delegate"

Item {
    id: idContentHeader
    width: idArticleContent.width
    height: contentColumn.height

    property string txtArticleTitle: ApplicationInfo.currentTitleArticle;
    property string txtArticleThumbnaiImageFromSource: ApplicationInfo.currenLinkSourceDomainArticle;
    property string txtArticleTime: ApplicationInfo.currentTimeArticle;
    property string txtArticleNameSource: ApplicationInfo.currentSourceInfoArticle;

    Column {
        id:contentColumn
        spacing: 5

        Text {
            id: idTitle
            text: txtArticleTitle
            font.family: "Helvetica"
            font.pointSize: 24
            width: idContentHeader.width - 10
            horizontalAlignment: Text.AlignHCenter
            wrapMode: Text.WrapAtWordBoundaryOrAnywhere
        }

        Line {}

        Row {
            id: rowHeader
            height: 100
            spacing: 20

            Image {
                id: idThumbnaiImage
                source: txtArticleThumbnaiImageFromSource

                onStatusChanged: {
                    if (idThumbnaiImage.status === Image.Ready) {
                        rowHeader.height =  idThumbnaiImage.height;
                    }
                }
            }

            Text {
                id: idSourceArticle
                text: txtArticleNameSource
                font.family: "Arial"
                font.italic: true
                //verticalAlignment: Text.AlignBottom
                opacity: 0.5

                height: parent.height
                anchors.verticalCenter: Text.verticalCenter
            }

            Text {
                id: idTime
                text: txtArticleTime
                font.family: "Arial"
                font.italic: true
                //verticalAlignment: Text.AlignBottom
                opacity: 0.5

                height: parent.height
                anchors.verticalCenter: Text.verticalCenter
            }
        }

        Line {}
    }


}
